#!/bin/sh

echo "Welcome to ABM"

# Mount things needed by this script
mkdir /proc
mkdir /sys
mkdir /etc
mkdir /mnt
mount -t proc proc /proc
mount -t sysfs sysfs /sys

mkdir /config
mount -t configfs -o nodev,noexec,nosuid configfs /config

# Create all the symlinks to /bin/busybox
mkdir -p /usr/bin
mkdir -p /sbin
mkdir -p /usr/sbin
echo "Installing Busybox..." && /bin/busybox --install -s

echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s

. /env.sh

export DEVICE_DPI DEVICECODENAME SD_META_PATH TOUCHSCREEN_PATH DEBUG

#mount tmpfs /dev
/usb-tethering 
telnetd -b 10.15.19.82:23 -l /bin/sh &
sleep 3
#abm "$DEVICE_DPI" "$DEVICECODENAME" "$SD_META_PATH" "$TOUCHSCREEN_PATH"
exec /boot-android-sar.sh
echo "hi abm" > /dev/kmsg
while true
do
    telnetd -b 10.15.19.82:23 -l /bin/sh
    sleep 1
done

